

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import java.awt.Color;
import java.awt.SystemColor;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;
import javax.swing.JSplitPane;
import java.awt.Dimension;
import java.awt.BorderLayout;
import javax.swing.JList;

public class SearchPanel extends JPanel {
	PreparedStatement pstmt = null;
	ResultSet rs  = null;
	private Connection conn;
	private JSplitPane splitPane;
	private JButton button;
	private JButton button_1;
	private JPanel panel;
	private JPanel panel_1;
	private JLabel label;
	private JLabel label_1;
	private JLabel label_2;
	private JLabel label_3;
	private JLabel label_4;
	private JPanel panel_2;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JList list;
	private JLabel label_5;
	private JLabel label_6;
	private JLabel label_7;
	private JLabel label_8;
	private JLabel label_9;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JLabel label_10;
	private JTextField textField_8;
	private JButton button_2;
	private JLabel label_11;
	private JTextField textField_9;
	
	
	private void connect() throws SQLException, ClassNotFoundException
	{
		conn = DBconn.getConnection();
	}
	
	private void close() throws SQLException
	{
		DBconn.close();
		conn = null;
	}
	

	/**
	 * Create the panel.
	 */
	public SearchPanel() {
		setLayout(new BorderLayout(0, 0));
		add(getSplitPane());
		add(getPanel());
		add(getPanel_1());
		add(getPanel_2());

	}
	private JSplitPane getSplitPane() {
		if (splitPane == null) {
			splitPane = new JSplitPane();
			splitPane.setLeftComponent(getButton());
			splitPane.setRightComponent(getButton_1());
		}
		return splitPane;
	}
	private JButton getButton() {
		if (button == null) {
			button = new JButton("초기화");
			button.setMinimumSize(new Dimension(120, 23));
			button.setMaximumSize(new Dimension(120, 23));
		}
		return button;
	}
	private JButton getButton_1() {
		if (button_1 == null) {
			button_1 = new JButton("입력");
		}
		return button_1;
	}
	private JPanel getPanel() {
		if (panel == null) {
			panel = new JPanel();
			panel.setPreferredSize(new Dimension(10, 34));
			panel.setLayout(new BorderLayout(0, 0));
		}
		return panel;
	}
	private JPanel getPanel_1() {
		if (panel_1 == null) {
			panel_1 = new JPanel();
			panel_1.setLayout(null);
			panel_1.setPreferredSize(new Dimension(120, 10));
			panel_1.setMinimumSize(new Dimension(30, 30));
			panel_1.add(getLabel());
			panel_1.add(getLabel_1());
			panel_1.add(getLabel_2());
			panel_1.add(getLabel_3());
			panel_1.add(getLabel_4());
		}
		return panel_1;
	}
	private JLabel getLabel() {
		if (label == null) {
			label = new JLabel("First Name : ");
			label.setBounds(10, 39, 96, 15);
		}
		return label;
	}
	private JLabel getLabel_1() {
		if (label_1 == null) {
			label_1 = new JLabel("Last Name :");
			label_1.setBounds(11, 70, 96, 15);
		}
		return label_1;
	}
	private JLabel getLabel_2() {
		if (label_2 == null) {
			label_2 = new JLabel("Department ID : ");
			label_2.setBounds(12, 101, 96, 15);
		}
		return label_2;
	}
	private JLabel getLabel_3() {
		if (label_3 == null) {
			label_3 = new JLabel("Job ID :");
			label_3.setBounds(12, 134, 96, 15);
		}
		return label_3;
	}
	private JLabel getLabel_4() {
		if (label_4 == null) {
			label_4 = new JLabel("* 필수 입력 *");
			label_4.setBounds(12, 10, 96, 15);
		}
		return label_4;
	}
	private JPanel getPanel_2() {
		if (panel_2 == null) {
			panel_2 = new JPanel();
			panel_2.setLayout(null);
			panel_2.add(getTextField());
			panel_2.add(getTextField_1());
			panel_2.add(getTextField_2());
			panel_2.add(getTextField_3());
			panel_2.add(getList());
			panel_2.add(getLabel_5());
			panel_2.add(getLabel_6());
			panel_2.add(getLabel_7());
			panel_2.add(getLabel_8());
			panel_2.add(getLabel_9());
			panel_2.add(getTextField_4());
			panel_2.add(getTextField_5());
			panel_2.add(getTextField_6());
			panel_2.add(getTextField_7());
			panel_2.add(getLabel_10());
			panel_2.add(getTextField_8());
			panel_2.add(getButton_2());
			panel_2.add(getLabel_11());
			panel_2.add(getTextField_9());
		}
		return panel_2;
	}
	private JTextField getTextField() {
		if (textField == null) {
			textField = new JTextField();
			textField.setColumns(10);
			textField.setBounds(12, 37, 116, 21);
		}
		return textField;
	}
	private JTextField getTextField_1() {
		if (textField_1 == null) {
			textField_1 = new JTextField();
			textField_1.setColumns(10);
			textField_1.setBounds(12, 68, 116, 21);
		}
		return textField_1;
	}
	private JTextField getTextField_2() {
		if (textField_2 == null) {
			textField_2 = new JTextField();
			textField_2.setColumns(10);
			textField_2.setBounds(12, 99, 116, 21);
		}
		return textField_2;
	}
	private JTextField getTextField_3() {
		if (textField_3 == null) {
			textField_3 = new JTextField();
			textField_3.setColumns(10);
			textField_3.setBounds(12, 130, 116, 21);
		}
		return textField_3;
	}
	private JList getList() {
		if (list == null) {
			list = new JList();
			list.setBounds(12, 229, 477, 80);
		}
		return list;
	}
	private JLabel getLabel_5() {
		if (label_5 == null) {
			label_5 = new JLabel("* 선택 입력 *");
			label_5.setBounds(192, 10, 96, 15);
		}
		return label_5;
	}
	private JLabel getLabel_6() {
		if (label_6 == null) {
			label_6 = new JLabel("E-mail :");
			label_6.setBounds(214, 40, 62, 15);
		}
		return label_6;
	}
	private JLabel getLabel_7() {
		if (label_7 == null) {
			label_7 = new JLabel("Phone Number :");
			label_7.setBounds(168, 71, 96, 15);
		}
		return label_7;
	}
	private JLabel getLabel_8() {
		if (label_8 == null) {
			label_8 = new JLabel("Manager ID :");
			label_8.setBounds(190, 102, 86, 15);
		}
		return label_8;
	}
	private JLabel getLabel_9() {
		if (label_9 == null) {
			label_9 = new JLabel("Hire Date : ");
			label_9.setBounds(204, 133, 72, 15);
		}
		return label_9;
	}
	private JTextField getTextField_4() {
		if (textField_4 == null) {
			textField_4 = new JTextField();
			textField_4.setColumns(10);
			textField_4.setBounds(273, 37, 216, 21);
		}
		return textField_4;
	}
	private JTextField getTextField_5() {
		if (textField_5 == null) {
			textField_5 = new JTextField();
			textField_5.setColumns(10);
			textField_5.setBounds(273, 68, 216, 21);
		}
		return textField_5;
	}
	private JTextField getTextField_6() {
		if (textField_6 == null) {
			textField_6 = new JTextField();
			textField_6.setColumns(10);
			textField_6.setBounds(273, 99, 216, 21);
		}
		return textField_6;
	}
	private JTextField getTextField_7() {
		if (textField_7 == null) {
			textField_7 = new JTextField();
			textField_7.setColumns(10);
			textField_7.setBounds(273, 130, 216, 21);
		}
		return textField_7;
	}
	private JLabel getLabel_10() {
		if (label_10 == null) {
			label_10 = new JLabel("Address : ");
			label_10.setBounds(12, 204, 72, 15);
		}
		return label_10;
	}
	private JTextField getTextField_8() {
		if (textField_8 == null) {
			textField_8 = new JTextField();
			textField_8.setColumns(10);
			textField_8.setBounds(62, 173, 145, 21);
		}
		return textField_8;
	}
	private JButton getButton_2() {
		if (button_2 == null) {
			button_2 = new JButton("우편번호 검색 ");
			button_2.setBounds(228, 172, 132, 23);
		}
		return button_2;
	}
	private JLabel getLabel_11() {
		if (label_11 == null) {
			label_11 = new JLabel("Post : ");
			label_11.setBounds(12, 176, 57, 15);
		}
		return label_11;
	}
	private JTextField getTextField_9() {
		if (textField_9 == null) {
			textField_9 = new JTextField();
			textField_9.setColumns(10);
			textField_9.setBounds(72, 201, 417, 21);
		}
		return textField_9;
	}
}
